//
//  MainTabBarViewController.m
//  HDYS
//
//  Created by qianfeng on 15-4-21.
//  Copyright (c) 2015年 kay. All rights reserved.
//

#import "MainTabBarViewController.h"
#import "MainViewController.h"
#import "BuyViewController.h"
#import "ListCarViewController.h"
#import "MyselfViewController.h"

#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width


@interface MainTabBarViewController () 


@end

@implementation MainTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createViewControllers];
}

-(void)createViewControllers{
    MainViewController *mainVC = [[MainViewController alloc] init];
    UINavigationController *mainNavi = [[UINavigationController alloc] initWithRootViewController:mainVC];
    mainVC.navigationItem.title = @"首页";
    mainNavi.tabBarItem.title = @"首页";
//    UIImage *img = [UIImage imageNamed:@"btn_confirm_87x36@2x"];
//    UIImage *newImg = [img stretchableImageWithLeftCapWidth:10 topCapHeight:30];
//    [[UINavigationBar appearance] setBackgroundImage:newImg forBarMetrics:UIBarMetricsDefault];
    
    BuyViewController *buyVC = [[BuyViewController alloc] init];
    UINavigationController *buyNavi = [[UINavigationController alloc] initWithRootViewController:buyVC];
    buyNavi.tabBarItem.title = @"买";
    buyVC.navigationItem.title = @"买";
    
    ListCarViewController *listVC = [[ListCarViewController alloc] init];
    UINavigationController *listNavi = [[UINavigationController alloc] initWithRootViewController:listVC];
    listNavi.tabBarItem.title = @"购物车";
    listVC.navigationItem.title = @"购物车";
    
    MyselfViewController *myselfVC = [[MyselfViewController alloc] init];
    UINavigationController *myselfNavi = [[UINavigationController alloc] initWithRootViewController:myselfVC];
    myselfNavi.tabBarItem.title = @"我";
    
    myselfVC.navigationItem.title = @"我";
    
    self.viewControllers = @[mainNavi, buyNavi, listNavi, myselfNavi];
    self.tabBar.translucent = NO;
    
//    NSArray *imageArray = @[@"1003033",@"1003079",@"1003075",@"1003131"];
//    for (int i = 0; i < imageArray.count; i++) {
//        UIImage *image = [UIImage imageNamed:imageArray[i]];
//        UIImage *newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//        UITabBarItem *item = self.tabBar.items[i];
//        [item setFinishedSelectedImage:newImage withFinishedUnselectedImage:newImage];
//    }
}






@end
